home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / lang / intro / smilectl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-06  |  1.7 KB  |  73 lines

  1. // smilectl.h : Declaration of the CSmileCtrl OLE control class.
  2.  
  3. /////////////////////////////////////////////////////////////////////////////
  4. // CSmileCtrl : See smilectl.cpp for implementation.
  5.  
  6. class CSmileCtrl : public COleControl
  7. {
  8.     DECLARE_DYNCREATE(CSmileCtrl)
  9.  
  10. // Constructor
  11. public:
  12.     CSmileCtrl();
  13.  
  14. // Overrides
  15.  
  16.     // Drawing function
  17.     virtual void OnDraw(
  18.                 CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  19.  
  20.     // Persistence
  21.     virtual void DoPropExchange(CPropExchange* pPX);
  22.  
  23.     // Reset control state
  24.     virtual void OnResetState();
  25.  
  26. // Implementation
  27. protected:
  28.     ~CSmileCtrl();
  29.  
  30.     BOOL InEllipse(const CPoint& pt, int x1, int y1, int x2, int y2);
  31.  
  32.     DECLARE_OLECREATE_EX(CSmileCtrl)    // Class factory and guid
  33.     DECLARE_OLETYPELIB(CSmileCtrl)      // GetTypeInfo
  34.     DECLARE_PROPPAGEIDS(CSmileCtrl)     // Property page IDs
  35.     DECLARE_OLECTLTYPE(CSmileCtrl)        // Type name and misc status
  36.  
  37. // Message maps
  38.     //{{AFX_MSG(CSmileCtrl)
  39.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  40.     //}}AFX_MSG
  41.     DECLARE_MESSAGE_MAP()
  42.  
  43. // Dispatch maps
  44.     //{{AFX_DISPATCH(CSmileCtrl)
  45.     BOOL m_sad;
  46.     afx_msg void OnSadChanged();
  47.     afx_msg void Beep(short uAlert);
  48.     //}}AFX_DISPATCH
  49.     DECLARE_DISPATCH_MAP()
  50.  
  51.     afx_msg void AboutBox();
  52.  
  53. // Event maps
  54.     //{{AFX_EVENT(CSmileCtrl)
  55.     void FireOutside()
  56.         {FireEvent(eventidOutside,EVENT_PARAM(VTS_NONE));}
  57.     void FireInside(short X, short Y)
  58.         {FireEvent(eventidInside,EVENT_PARAM(VTS_I2  VTS_I2), X, Y);}
  59.     //}}AFX_EVENT
  60.     DECLARE_EVENT_MAP()
  61.  
  62. // Dispatch and event IDs
  63. public:
  64.     enum {
  65.     //{{AFX_DISP_ID(CSmileCtrl)
  66.     dispidSad = 1L,
  67.     dispidBeep = 2L,
  68.     eventidOutside = 1L,
  69.     eventidInside = 2L,
  70.     //}}AFX_DISP_ID
  71.     };
  72. };
  73.